<?php
/**
 * Klasse zur Erzeugung eines Bootstrap Carousel
 *
 * @author		Joachim Ruf, Loresoft Software (http://www.loresoft.de)
 * @license		New BSD License
 * @version		Class for Bootstrap v2.3.2
 *
 * */


Class Bootstrap_Modal_Handler
{
	private $content = '';
	private $oHeader;
	private $oFooter;


	/**
	 * Create a Modal-Box
	 * Requires <a href="#myModalId" data-toggle="modal">openModal</a>
	 * */
	function __construct () {
		$this->oHeader	= new Bootstrap_Modal_Header();
		$this->oFooter	= new Bootstrap_Modal_Footer();
	}


	/**
	 * Gibt den Modal-Header zur weiteren Bearbeitung aus
	 * @return Bootstrap_Modal_Header
	 * */
	public function &getHeader () {
		return $this->oHeader;
	}


	/**
	 * Gibt den Modal-Footer zur weiteren Bearbeitung aus
	 * @return Bootstrap_Modal_Footer
	 * */
	public function &getFooter () {
		return $this->oFooter;
	}


	/**
	 * Fuegt neuen Content hinzu
	 * @return void
	 * */
	public function addContent ($_content) {
		return $this->content .= $_content;
	}




	public function display ($_id) {
		return '<div id="'.$_id.'" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
				    <div class="modal-header">
					    '.$this->oHeader->getButtonClose().'
			    		'.$this->oHeader->getHeadline().'
				    </div>
				    <div class="modal-body">
					    '.$this->content.'
				    </div>
				    <div class="modal-footer">
			    		'.$this->oFooter->getContent().'
				    </div>
			    </div>
				';
	}


}


?>